package cn.hh.wechatkit.pojo.token;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * Created by HMH on 2017/4/5.
 * JSApi 令牌
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class WxToken_JsApiToken {
    private String errcode;
    private String errmsg;
    private String ticket;
    private long expires_in;
    private long expires_time;

    public boolean isExpired() {
        return expires_time < System.currentTimeMillis();
    }

    public Boolean hasError() {
        return !"0".equals(errcode);
    }

}
